using System.Collections.Generic;

namespace Commons.Transactions
{
	public class TransactionManager : ITransactional
	{
		public List<ITransactional> Transactionals { protected get; set; }

		public void BeginTransaction()
		{
			foreach (ITransactional transactional in Transactionals)
			{
				transactional.BeginTransaction();
			}
		}

		public void Commit()
		{
			foreach (ITransactional transactional in Transactionals)
			{
				transactional.Commit();
			}
		}

		public void Rollback()
		{
			foreach (ITransactional transactional in Transactionals)
			{
				transactional.Rollback();
			}
		}
	}
}

